package com.ruoyan.mapper;

import com.ruoyan.pojo.Employee;
import lombok.Data;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Package: com.ruoyan.Mapper
 * @ClassName: EmployeeMapper
 * @Author: ruoyan1998
 * @CreateTime: 2021/5/19 16:16
 * @Description:
 */
@Mapper
public interface EmployeeMapper
{
    /**
     * 查询所有员工的信息（不包含工资，奖金，备注）
     *
     * @return List<Employee>*/
    List<Employee> queryEmployeeList();

    /**
     * 根据id查询某个员工（不包含工资，奖金，备注）
     *
     * @param id
     * @return Employee*/
    Employee queryEmployeeById(int id);


    /**
     * 根据did查询员工的所属部门id值和姓名，用于查找部门中所属员工
     *
     * @param did
     * @return List<Employee>*/
    List<Employee> queryEmployeeByDid(int did);


    Employee queryEmployeeByIdAndDid(int id,int did);

    /**
     * 添加员工
     *
     * @param employee
     * @return int*/
    int addEmployee(Employee employee);

    /**
     * 更新员工信息（不包含工资，奖金，备注）
     *
     * @param employee
     * @return int*/
    int updateEmployee(Employee employee);

    /**
     * 删除员工
     *
     * @param id
     * @return int*/
    int deleteEmployee(int id);

    /**
     * 查询所有员工的工资，奖金，备注信息
     *
     * @return List<Employee>*/
    List<Employee> queryEmployeeSalaryList();

    /**
     * 根据id查询某位员工的工资，奖金，备注信息
     *
     * @param id
     * @return employee*/
    Employee queryEmployeeSalaryById(int id);

    /**
     * 更新员工工资信息（不包含工资，奖金，备注）
     *
     * @param employee
     * @return int*/
    int updateEmployeeSalary(Employee employee);
}
